﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.Serialization;
using System.ServiceModel;
using System.Text;
using Backup.Services.Entities;

namespace BackupWebRole.Services
{
    // NOTE: You can use the "Rename" command on the "Refactor" menu to change the interface name "ITagWebService" in both code and config file together.
    [ServiceContract]
    public interface ITagWebService
    {        
        /// <summary>
        /// Save the given tag.
        /// </summary>
        /// <param name="tagEntity">The tag to save.</param>
        /// <returns>The saved tag( with new id when the original id was default value).</returns>
        [OperationContract]
        TagEntity Save(TagEntity tagEntity, Credentials credentials);

        /// <summary>
        /// Delete the given tag.
        /// </summary>
        /// <param name="id">The tag id to delete.</param>
        /// <remarks>Only the Id need to be set to the tag entity.</remarks>
        [OperationContract]
        void Delete(Guid id, Credentials credentials);

        /// <summary>
        /// Load a tag based on the id.
        /// </summary>
        /// <param name="id">The id of the tag.</param>
        /// <returns>The tag with the given id.</returns>
        [OperationContract]
        TagEntity Load(Guid id, Credentials credentials);

        /// <summary>
        /// Load all tags from repository.
        /// </summary>
        /// <returns></returns>
        [OperationContract]
        List<TagEntity> LoadAll(Credentials credentials);

        /// <summary>
        /// Load a list of specific tags based on ids.
        /// </summary>
        /// <param name="ids">The list of ids</param>
        /// <returns>The list of tags with the given ids</returns>
        [OperationContract]
        List<TagEntity> LoadAllByIds(List<Guid> ids, Credentials credentials);

        /// <summary>
        /// Get all the childrens of the given tag.
        /// </summary>
        /// <param name="tag"></param>
        /// <returns></returns>
        [OperationContract]
        List<TagEntity> GetChildrens(TagEntity tag, Credentials credentials);

        /// <summary>
        /// Get the parent of the given tag.
        /// </summary>
        /// <returns>The parent tag of the given tag</returns>
        [OperationContract]
        TagEntity GetParent(TagEntity tag, Credentials credentials);
    }
}
